/**
 * 
 */
package infomanager;

import info.Constant;

import java.util.ArrayList;

import evolution.Generation;
import evolution.Individual;

/**
 * @author vtkhanh
 * 
 */
public class GenerationManager {
    public static void evaluate(Generation generation,
	    Generation nextGeneration, boolean isModified) {
	ArrayList<Individual> individuals = generation.getIndividuals();
	int count = 0;

	for (Individual individual : individuals) {
	    IndividualManager.evaluate(individual, nextGeneration, isModified);

	    if (nextGeneration != null) {
		System.out.println(++count + " - size : " + nextGeneration.getSize());
		if (nextGeneration.getSize() > Constant.MAX_GENERATION_SIZE) {
		    break;
		}
	    }
	}
    }
}
